﻿<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Site.master"  %>
<%@ Import Namespace="FMWeb.CSCode" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            lv_scoreboard.DataSource = ScoreManager.GetHighScores();
            lv_scoreboard.DataBind();
        }

        protected Highscore CurrentItem(object Container)
        {
            return (Container as ListViewDataItem).DataItem as Highscore;
        }
    </script>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Scoreboard
    </h2>
    <p>
        <asp:ListView runat="server" ID="lv_scoreboard">
            <LayoutTemplate>
                <table>
                  <tr runat="server" id="itemPlaceholder" ></tr>
                </table>
              </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td style="text-align:right;">
                        <%# CurrentItem(Container).rank %>
                    </td>
                    <td>
                    &nbsp;
                        <%# CurrentItem(Container).name %>
                    </td>
                    <td style="text-align:right;">
                    &nbsp;
                        <%# CurrentItem(Container).highScore %>
                    </td>
                
                </tr>
            </ItemTemplate>
            
        </asp:ListView>
    </p>
</asp:Content>
